<%@ page import="java.util.Date" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- Bootstrap CSS-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/vendor/bootstrap/css/bootstrap.css">
    <!-- Font Awesome CSS-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/vendor/font-awesome/css/font-awesome.min.css">
    <!-- Custom Font Icons CSS-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/font.css">
    <!-- theme stylesheet-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/style.default.css" id="theme-stylesheet">
    <!-- Custom stylesheet - for your changes-->
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/custom.css">
	    <link rel="stylesheet" href="${pageContext.request.contextPath}/bootstrap/css/bootstrap-select.min.css">
    <title>会议系统</title>

</head>
<body>
<%@include file="header.jsp"%>

<div class="d-flex align-items-stretch">
    <!-- Sidebar Navigation-->
    <%@include file="nav.jsp"%>
    <!-- Sidebar Navigation end-->
    <div class="page-content">
        <div class="page-header">
            <div class="container-fluid">
                <h2 class="h5 no-margin-bottom">会议系统</h2>
            </div>
        </div>

        <section class="no-padding-bottom">

            <div class="list-group">
                <!--搜索文章的条件-->
                <div class="myTitle">
                    <form class="form-inline" action="${pageContext.request.contextPath}/user/meetingList">
                        <div class="form-group">
                            <label for="inlineFormInput" class="sr-only">Name</label>
                            <input id="inlineFormInput" type="text" placeholder="按标题名字查找" class="mr-sm-3 form-control" name="meetingName">
                        </div>
                        
                        <!--选择状态-->
                        <div class="form-group" style="margin-right: 20px;">
                            <select name="dep" class="form-control selectpicker" id="status">
                                <option>请选择状态</option>
                                <option>未开始</option>
                                <option>正在进行</option>
                                <option>已结束</option>
                            </select>
                            <<input type="hidden" name="stat" id="s0" value="">
                        </div>
						
						<div class="form-group">
						    <input type="submit" value="查询" class="btn btn-primary mr-sm-3 ">
						</div>
                    </form>

                    <input id = "addMeet" type="submit" value="发布会议" class="btn btn-primary">


                </div>

                <ul class="myList">
                    <c:forEach items="${meetings.meetings}" var="m">
                        <li class="list-group-item">
                            <div style="float: right;">
                                <span><strong>状态：</strong>
                                    <c:if test="${date<m.startTime}">还未开始</c:if>
                                    <c:if test="${date>m.endTime}">已经结束</c:if>
                                    <c:if test="${date<m.endTime && date>m.startTime}">正在进行</c:if>
                                </span>
                            </div>
                            <a href="/user/meetDetail?id=${m.id}">${m.title}</a>
                            <p class="h6"><strong>部门：</strong>${m.deptName}</p>
                            <p class="h6"><strong>开始时间：</strong>${m.startTime}</p>
                            <p style="white-space:nowrap;overflow:hidden;text-overflow: ellipsis">
                                ${m.content}
                                    </p>
                        </li>
                    </c:forEach>
                </ul>

                <nav class="text-center" aria-label="Page navigation">
                    <ul class="pagination">
                        <li>
                            <a href="${pageContext.request.contextPath}/user/meetingList?currentPage=${meetings.currentPage-1<1? 1:meetings.currentPage-1}" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                        <c:forEach begin="1" end="${meetings.countPage}"  var="mc"><li><a href="${pageContext.request.contextPath}/user/meetingList?currentPage=${mc}">${mc}</a></li></c:forEach>
                        <li>
                            <a href="${pageContext.request.contextPath}/user/meetingList?currentPage=${meetings.currentPage+1>meetings.countPage?meetings.countPage:meetings.currentPage+1}" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </section>

        <%@include file="footer.jsp"%>
    </div>
</div>

<!-- JavaScript files-->
<%@include file="floor.jsp"%>
</body>
</html>